package com.drug.wms.service.impl;

import com.drug.common.utils.DateUtils;
import com.drug.wms.domain.BusBankAccInfo;
import com.drug.wms.mapper.BusBankAccInfoMapper;
import com.drug.wms.service.IBusBankAccInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 银行信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-11-10
 */
@Service
public class BusBankAccInfoServiceImpl implements IBusBankAccInfoService {
    @Autowired
    private BusBankAccInfoMapper busBankAccInfoMapper;

    /**
     * 查询银行信息
     *
     * @param id 银行信息主键
     * @return 银行信息
     */
    @Override
    public BusBankAccInfo selectBusBankAccInfoById(String id) {
        return busBankAccInfoMapper.selectBusBankAccInfoById(id);
    }

    /**
     * 查询银行信息列表
     *
     * @param busBankAccInfo 银行信息
     * @return 银行信息
     */
    @Override
    public List<BusBankAccInfo> selectBusBankAccInfoList(BusBankAccInfo busBankAccInfo) {
        return busBankAccInfoMapper.selectBusBankAccInfoList(busBankAccInfo);
    }

    /**
     * 新增银行信息
     *
     * @param busBankAccInfo 银行信息
     * @return 结果
     */
    @Override
    public int insertBusBankAccInfo(BusBankAccInfo busBankAccInfo) {
        busBankAccInfo.setCreateTime(DateUtils.getNowDate());
        return busBankAccInfoMapper.insertBusBankAccInfo(busBankAccInfo);
    }

    /**
     * 修改银行信息
     *
     * @param busBankAccInfo 银行信息
     * @return 结果
     */
    @Override
    public int updateBusBankAccInfo(BusBankAccInfo busBankAccInfo) {
        busBankAccInfo.setUpdateTime(DateUtils.getNowDate());
        return busBankAccInfoMapper.updateBusBankAccInfo(busBankAccInfo);
    }

    /**
     * 批量删除银行信息
     *
     * @param ids 需要删除的银行信息主键
     * @return 结果
     */
    @Override
    public int deleteBusBankAccInfoByIds(String[] ids) {
        return busBankAccInfoMapper.deleteBusBankAccInfoByIds(ids);
    }

    /**
     * 删除银行信息信息
     *
     * @param id 银行信息主键
     * @return 结果
     */
    @Override
    public int deleteBusBankAccInfoById(String id) {
        return busBankAccInfoMapper.deleteBusBankAccInfoById(id);
    }
}
